//
//  Utils.m
//  TencentWB
//
//  Created by kong_jinbiao on 14-5-20.
//  Copyright (c) 2014年 user. All rights reserved.
//

#import "Utils.h"

@implementation Utils

+(void)setTokenInfo:(WeiboApiObject *)weiboApiObj;
{
    [[NSUserDefaults standardUserDefaults] setObject:weiboApiObj.appKey forKey:OAUTH_CONSUMER_KEY];
    [[NSUserDefaults standardUserDefaults] setObject:weiboApiObj.accessToken forKey:ACCESS_TOKEN];
    [[NSUserDefaults standardUserDefaults] setObject:weiboApiObj.openid forKey:OPEN_ID];
    [[NSUserDefaults standardUserDefaults]synchronize];
//    [[NSUserDefaults standardUserDefaults] setObject:weiboApiObj. forKey:CLIENT_IP];
//    [[NSUserDefaults standardUserDefaults] setObject:@"2.a" forKey:OAUTH_VERSION];
//    [[NSUserDefaults standardUserDefaults] setObject:@"all" forKey:SCOPE];
}

+(WeiboApiObject *)getTokenInfo
{
    WeiboApiObject *tmpWeiboObjc = [[WeiboApiObject alloc]init];
    tmpWeiboObjc.appKey = [[NSUserDefaults standardUserDefaults] objectForKey:OAUTH_CONSUMER_KEY];
    tmpWeiboObjc.accessToken = [[NSUserDefaults standardUserDefaults] objectForKey:ACCESS_TOKEN];
    tmpWeiboObjc.openid = [[NSUserDefaults standardUserDefaults] objectForKey:OPEN_ID];
    
    return tmpWeiboObjc;
}

@end
